package com.ftg.learn.day07;

import java.util.Arrays;

/**
 * 定义
 * 类型[][]  as = new 类型[3][];
 * <p>
 * 叫一维数组里面第一个元素还是一个一维数组
 * <p>
 * <p>
 * 内存
 * <p>
 * <p>
 * 赋値
 * <p>
 * lou[8][3][1] = 45;
 * <p>
 * 取値
 * lou[8][3][1]
 * 循环
 *
 * @author kangjx
 * @version 1.0
 * @date 2023/7/19 上午10:42
 */
public class MultiArray {

    public static void main(String[] args) {
        int[][] b = new int[5][5];
        int[][] a = new int[5][5];

        for (int i = 0, x = 1; i < a.length; i++) {
            for (int i1 = 0; i1 < a[i].length; i1++) {
                a[i][i1] = x++;
            }
        }

        for (int i = 0, x = 1; i < a.length; i++) {
            System.out.println(Arrays.toString(a[i]));
        }


        for (int i = 0, x = 1; i < a.length; i++) {
            for (int i1 = 0; i1 < a[i].length; i1++) {
                System.out.println(a[i][i1]);
            }
        }



    }

}
